package com.mywork.mvpkodeinxml.net.api

import com.mywork.retrofitfileconverter.FileConverter
import io.reactivex.Flowable
import io.reactivex.Observable
import okhttp3.ResponseBody
import retrofit2.http.*
import java.io.File

interface DownloadApi {
    @Streaming
    @GET("/KrsIPUI/T95Service/EmFileHandler.ashx?optag=2")
    fun downloadManual(@Query("userCode") userCode: String, @Query("userPassword") userPassword: String, @Query("formid") formId: String): Flowable<ResponseBody>

    @Streaming
    @GET("/KrsIPUI/T95Service/EmFileHandler.ashx?optag=2")
    fun download(
        @Query("userCode") userCode: String,
        @Query("userPassword") userPassword: String,
        @Query("formid") formId: String,
        @Header(FileConverter.SAVE_PATH) path: String
    ): Observable<File>
}
